#include <QApplication>
#include "window_manager.h"

#include "../process_files/data_processor.h"

Window_manager::Window_manager(QObject *parent)
    : QObject(parent)
    , processor_(new Data_processor(this))
{
    init_connections();
}

void Window_manager::init_connections()
{
    connect(this, &Window_manager::si_exit_application,
            this, &Window_manager::sl_exit_application);

    // 传递用户选择，查询用户主机信息
    connect(this, &Window_manager::si_send_host_info,
            processor_, &Data_processor::sl_get_host_info);

    // 获取用户主机信息
    connect(processor_, &Data_processor::si_host_info,
            this, &Window_manager::si_get_host_info);
}

void Window_manager::sl_exit_application()
{
    qApp->closeAllWindows();
}

